package com.daiqee.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.daiqee.pojo.SupplierRepayment;
import com.daiqee.dao.mapper.SupplierRepaymentMapper;

@Service
public class SupplierRepaymentService extends ServiceImpl<SupplierRepaymentMapper, SupplierRepayment>{

	@Autowired
	private SupplierRepaymentMapper supplierRepaymentMapper;
	
	/**
	 * 查询供应商是否存在
	 * @Time 2018年3月20日08:40:02
	 * @since 2.1
	 * @version 2.1
	 * @author RichardTang
	 * @param supplierName
	 * 			供应商名称
	 * @return 查询结果对应的Boolean值
	 */
	public Boolean querySupplierIsExist(String supplierName) {
		List<SupplierRepayment> supplierList = supplierRepaymentMapper.selectList(
				new EntityWrapper<SupplierRepayment>().eq("sup_repay_supplier_name", supplierName)
		);
		if(supplierList==null||supplierList.isEmpty()||supplierList.size()<0) {
			return true;
		}
		return false;
	}
}
